import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/layout'),
    redirect: '/dashboard',
    children: [
      {
        path: '/dashboard',
        component: () => import('@/views/dashboard'),
        meta: {
          title: '仪表盘'
        }
      },
      {
        path: '/mall',
        component: () => import('@/views/mall'),
        meta: {
          title: '商品'
        }
      },
      {
        path: '/map1',
        component: () => import('@/views/map'),
        meta: {
          title: '百度地图'
        }
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '*',
    component: () => import('@/views/404')
  }
]

const router = new VueRouter({
  routes
})

export default router
